package de.nak.roommgmt.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import de.nak.roommgmt.model.Lecture;
import de.nak.roommgmt.service.LectureService;

public abstract class a extends ActionSupport {

	public a() {
		super();
	}

	/** {@inheritDoc} */
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
			throws Exception {
				// Get the service and load the lecture list
				LectureService lectureService = (LectureService)getWebApplicationContext().getBean("lectureService");
				List<Lecture> lectures = lectureService.listLectures();
				// Store the value in the form
				LectureForm lectureForm = (LectureForm)form;
				lectureForm.setLectures(lectures);
				// Return result
				return mapping.findForward("success");
			}

}